org.eclipse.core.contenttype: osgi.extender=osgi.component requirement#2162
org.eclipse.core.contenttype: osgi.extender=osgi.component requirement#2162laeubi merged 1 commit intoeclipse-platform:masterfrom
Conversation
org.eclipse.core.contenttype declares a service component, so it should also declare the requirement to the service extender. Otherwise, this can lead to exceptions such as the one below, in case no extender is added. This also adjusts org.eclipse.core.tests.harness accordingly, which builds a custom OSGI config.ini in CustomSessionConfigurationImpl and must now also include a SCR bundle (and its dependencies). We use org.apache.felix.scr here. This serves also as a preparation for eclipse-tycho/tycho#5362 org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources. at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:847) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:768) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1066) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:394) at org.eclipse.osgi.container.Module.doStart(Module.java:643) at org.eclipse.osgi.container.Module.start(Module.java:500) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:528) at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:622) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:353) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:417) at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:521) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:438) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:195) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3578) at java.base/java.lang.Class.getDeclaredMethods(Class.java:2676) at org.junit.platform.commons.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:1809) at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1649) at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1500) at org.junit.jupiter.engine.discovery.predicates.TestClassPredicates.hasTestOrTestFactoryOrTestTemplateMethods(TestClassPredicates.java:106) at org.junit.jupiter.engine.discovery.predicates.TestClassPredicates.looksLikeIntendedTestClass(TestClassPredicates.java:81) at org.junit.jupiter.engine.discovery.predicates.TestClassPredicates.looksLikeIntendedTestClass(TestClassPredicates.java:75) at org.junit.jupiter.engine.discovery.ClassSelectorResolver.isAcceptedStandaloneTestClass(ClassSelectorResolver.java:115) at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolveStandaloneTestClass(ClassSelectorResolver.java:106) at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:102) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:135) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:126) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:148) at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:63) at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:70) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:195) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:174) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:119) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:84) at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:104) at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:83) at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42) at org.junit.platform.launcher.core.InterceptingLauncher.lambda$discover$0(InterceptingLauncher.java:33) at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25) at org.junit.platform.launcher.core.InterceptingLauncher.discover(InterceptingLauncher.java:33) at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42) at org.apache.maven.surefire.junitplatform.LazyLauncher.discover(LazyLauncher.java:50) at org.apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:52) at org.apache.maven.surefire.api.util.DefaultScanResult.applyFilter(DefaultScanResult.java:87) at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:144) at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:137) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:148) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:88) at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.invokeSureFire(OsgiSurefireBooter.java:195) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:116) at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.start(HeadlessTestApplication.java:29) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:627) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) at org.eclipse.equinox.launcher.Main.run(Main.java:1431) at org.eclipse.equinox.launcher.Main.main(Main.java:1403) Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.core.runtime.content.IContentTypeManager.addContentTypeChangeListener(org.eclipse.core.runtime.content.IContentTypeManager$IContentTypeChangeListener)" because the return value of "org.eclipse.core.runtime.Platform.getContentTypeManager()" is null at org.eclipse.core.internal.resources.CharsetDeltaJob.startup(CharsetDeltaJob.java:266) at org.eclipse.core.internal.resources.CharsetManager.startup(CharsetManager.java:590) at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2681) at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2369) at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:591) at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:1) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:947) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:257) at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184) at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:324) at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:267) at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:565) at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:826) at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1) at java.base/java.security.AccessController.doPrivileged(AccessController.java:571) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:818) ... 81 more Root exception: java.lang.NullPointerException: Cannot invoke "org.eclipse.core.runtime.content.IContentTypeManager.addContentTypeChangeListener(org.eclipse.core.runtime.content.IContentTypeManager$IContentTypeChangeListener)" because the return value of "org.eclipse.core.runtime.Platform.getContentTypeManager()" is null at org.eclipse.core.internal.resources.CharsetDeltaJob.startup(CharsetDeltaJob.java:266) at org.eclipse.core.internal.resources.CharsetManager.startup(CharsetManager.java:590) at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2681) at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2369) at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:591) at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:1) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:947) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:257) at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184) at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:324) at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:267) at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:565) at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:826) at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1) at java.base/java.security.AccessController.doPrivileged(AccessController.java:571) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:818) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:768) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1066) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:394) at org.eclipse.osgi.container.Module.doStart(Module.java:643) at org.eclipse.osgi.container.Module.start(Module.java:500) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:528) at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:622) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:353) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:417) at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:521) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:438) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:195) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3578) at java.base/java.lang.Class.getDeclaredMethods(Class.java:2676) at org.junit.platform.commons.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:1809) at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1649) at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1500) at org.junit.jupiter.engine.discovery.predicates.TestClassPredicates.hasTestOrTestFactoryOrTestTemplateMethods(TestClassPredicates.java:106) at org.junit.jupiter.engine.discovery.predicates.TestClassPredicates.looksLikeIntendedTestClass(TestClassPredicates.java:81) at org.junit.jupiter.engine.discovery.predicates.TestClassPredicates.looksLikeIntendedTestClass(TestClassPredicates.java:75) at org.junit.jupiter.engine.discovery.ClassSelectorResolver.isAcceptedStandaloneTestClass(ClassSelectorResolver.java:115) at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolveStandaloneTestClass(ClassSelectorResolver.java:106) at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:102) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:135) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:189) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:126) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:92) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:83) at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:148) at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:63) at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:70) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:195) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:174) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:119) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:84) at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:104) at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:83) at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42) at org.junit.platform.launcher.core.InterceptingLauncher.lambda$discover$0(InterceptingLauncher.java:33) at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25) at org.junit.platform.launcher.core.InterceptingLauncher.discover(InterceptingLauncher.java:33) at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42) at org.apache.maven.surefire.junitplatform.LazyLauncher.discover(LazyLauncher.java:50) at org.apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:52) at org.apache.maven.surefire.api.util.DefaultScanResult.applyFilter(DefaultScanResult.java:87) at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:144) at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:137) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:148) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:88) at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.invokeSureFire(OsgiSurefireBooter.java:195) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:116) at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.start(HeadlessTestApplication.java:29) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:627) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) at org.eclipse.equinox.launcher.Main.run(Main.java:1431) at org.eclipse.equinox.launcher.Main.main(Main.java:1403)
| // org.apache.felix.scr + dependencies | ||
| Bundle scrBundle = FrameworkUtil.getBundle(org.apache.felix.scr.info.ScrInfo.class); | ||
| Collection<Bundle> scrAndDependencies = new HashSet<>(); | ||
| collectDependencies(scrBundle, scrAndDependencies); |
There was a problem hiding this comment.
Should we maybe better list dependencies (are there many?) explicitly to not pull in too much or optional things unintentionally?
There was a problem hiding this comment.
It's these:
org.apache.felix.scr
org.osgi.service.cm
org.eclipse.osgi
org.osgi.service.metatype
org.apache.felix.gogo.runtime
org.osgi.service.event
org.osgi.service.component
org.osgi.util.promise
org.osgi.util.function
org.osgi.util.promise
I thought about importing a package from each and specifying them each explicitly. But I am not sure how stable that would be and how often dependencies change here and we'd have to adapt.
There was a problem hiding this comment.
These dependencies are in fact optional:
org.osgi.service.metatype
org.osgi.service.cm
org.apache.felix.gogo.runtime
but I guess this won't hurt - it's still pretty minimal and they don't depend on anything else we don't already need.
And it's easier to maintain like this.
There was a problem hiding this comment.
Your gut feeling was right, this was indeed pulling in too much.
org.eclipse.osgi is used as the osgi.framework in the config.ini, so we should not redundantly add that to osgi.bundles as well, as this would cause error log entries.
| Automatic-Module-Name: org.eclipse.core.contenttype | ||
| Service-Component: OSGI-INF/org.eclipse.core.internal.content.ContentTypeManager.xml | ||
| Require-Capability: osgi.extender; | ||
| filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))" |
There was a problem hiding this comment.
Project settings say we use 1.4 (but currently only 1.1 features are used) so maybe we should just increase to 1.4 now to be safe in the future. On the other hand one likely will not find any compatible SCR impl for 1.2 anymore anyways :-)
There was a problem hiding this comment.
I copied this from the neighboring org.eclipse.e4.core.services for consistency.
…se-platform#2162) org.eclipse.core.tests.session.ConfigurationSessionTestSuite must be adjusted in the same way as org.eclipse.core.tests.harness.session.customization.CustomSessionConfigurationImpl
org.eclipse.core.tests.session.ConfigurationSessionTestSuite must be adjusted in the same way as org.eclipse.core.tests.harness.session.customization.CustomSessionConfigurationImpl
Some test cases use 'org.eclipse.core.runtime' as dependency. One of the runtime's dependencies (org.eclipse.core.contenttype) uses declarative services to provide a service component, but was missing the Require-Capability: header to require the osgi.extender=osgi.component. In eclipse-platform/eclipse.platform#2162 this was correct. But as a result, for the resolution of org.eclipse.core.runtime to succeed, a OSGI extender provider must now strictly be present. This cannot be auto-resolved as the PDE API tooling tests, as these tests are quite special and the bundles available in the resolver state are hand-picked by TestSuiteHelper.addAllRequired(IApiBaseline, Set<String>, IApiComponent, List<IApiComponent>) which currently does not support this kind of dependency. To work around that, we check if we find a dependency on SCR and if so, add an implementation for it to the baseline fixture: org.apache.felix.scr and its dependencies.
Some test cases use 'org.eclipse.core.runtime' as dependency. One of the runtime's dependencies (org.eclipse.core.contenttype) uses declarative services to provide a service component, but was missing the Require-Capability: header to require the osgi.extender=osgi.component. In eclipse-platform/eclipse.platform#2162 this was corrected. But as a result, for the resolution of org.eclipse.core.runtime to succeed, a OSGI extender provider must now strictly be present. This cannot be auto-resolved by the PDE API tooling tests, as these tests are quite special and the bundles available in the resolver state are hand-picked by TestSuiteHelper.addAllRequired(IApiBaseline, Set<String>, IApiComponent, List<IApiComponent>) which currently does not support this kind of dependency. To work around that, we check if we find a dependency on SCR and if so, add an implementation for it to the baseline fixture: org.apache.felix.scr and its dependencies.
Some test cases use 'org.eclipse.core.runtime' as dependency. One of the runtime's dependencies (org.eclipse.core.contenttype) uses declarative services to provide a service component, but was missing the Require-Capability: header to require the osgi.extender=osgi.component. In eclipse-platform/eclipse.platform#2162 this was corrected. But as a result, for the resolution of org.eclipse.core.runtime to succeed, a OSGI extender provider must now strictly be present. This cannot be auto-resolved by the PDE API tooling tests, as these tests are quite special and the bundles available in the resolver state are hand-picked by TestSuiteHelper.addAllRequired(IApiBaseline, Set<String>, IApiComponent, List<IApiComponent>) which currently does not support this kind of dependency. To work around that, we check if we find a dependency on SCR and if so, add an implementation for it to the baseline fixture: org.apache.felix.scr and its dependencies.
- The algorithm only considers bundle requirements so the new Require-Cpability in org.eclipse.core.contenttype misses dependencies causing resolution errors that fail some tests. eclipse-platform/eclipse.platform#2162
- The algorithm only considers bundle requirements so the new Require-Cpability in org.eclipse.core.contenttype misses dependencies causing resolution errors that fail some tests. eclipse-platform/eclipse.platform#2162
- Add bundles that are transitively required by org.eclipse.core.contenttype's new required capability. eclipse-platform/eclipse.platform#2162
- Add bundles that are transitively required by org.eclipse.core.contenttype's new required capability. eclipse-platform/eclipse.platform#2162
- The algorithm only considers bundle requirements so the new Require-Cpability in org.eclipse.core.contenttype misses dependencies causing resolution errors that fail some tests. eclipse-platform/eclipse.platform#2162
- Add bundles that are transitively required by org.eclipse.core.contenttype's new required capability. eclipse-platform/eclipse.platform#2162
org.eclipse.core.contenttype declares a service component, so it should also declare the requirement to the service extender.
Otherwise, this can lead to exceptions such as the one below, in case no extender is added.
This also adjusts org.eclipse.core.tests.harness accordingly, which builds a custom OSGI config.ini in CustomSessionConfigurationImpl and must now also include a SCR bundle (and its dependencies). We use org.apache.felix.scr here.
This serves also as a preparation for
eclipse-tycho/tycho#5362